﻿////测试文件
//#include "sdftest1.h"
//#include <stdlib.h>
//#include <string.h>
//#include <stdio.h>
//#include "openssl/ssl.h"
//#include <iostream>
#pragma warning(disable:4996)
//#include "util.h"
//
//int main() {
//	void ** pdh;
//	void* hsh;
//	int open,session,ret;
//	int i;
//	unsigned char* pcR;
//	unsigned int* hex;
//	DEVICEINFO *dev;
//	//创建设备信息
//	dev = (DEVICEINFO*)malloc(sizeof(DEVICEINFO));
//	strcpy((char*)(*dev).IssuerName, "LYMFC");
//	strcpy((char*)(*dev).DeviceName, "LMGM001");
//	strcpy((char*)(*dev).DeviceSerial, "2021042200112345");
//	(*dev).DeviceVersion = 0000;
//	(*dev).StandardVersion = 0000;
//	//(*dev).AsymAlgAbility = 11;
//	(*dev).SymAlgAbility = 0000;
//	(*dev).HashAlgAbility = 0000;
//	(*dev).BufferSize = 6666;
//	//设备定义结束
//
//	pdh=(void **) malloc(20);
//	hsh = (void*)malloc(20);
//	open = SDF_OpenDevice(pdh);//连接设备
//	if (!open)
//	{
//		session = SDF_OpenSession(hsh, pdh);//创建会话
//	if (!session)
//		{
//			SDF_GetDeviceInfo(hsh, dev);//读取设备信息
//		}
//	}
//	pcR = (unsigned char *)malloc((20+3)*4);
//	hex = (unsigned int*)malloc(100);
//	ret=SDF_GenerateRandom(hsh, 8, pcR);
//	if (!ret)
//	{
//		/*for ( i = 0; i < 10; i++)
//		{
//			printf("%d\n", pcR[i]);
//		}*/
//		puts((char*)pcR);
//		printf("随机数OK");
//	}
//}
//
//
//
#include "util.h"
#include <stdio.h>
#include <stdlib.h>
#include <typeinfo>
void main() {
	unsigned char* pBuf = NULL;
	unsigned int i;
	pBuf = (unsigned char*)malloc(72 * 128 * sizeof(unsigned char));
	unsigned char ba[] = { 0x07,0x5B,0xCD,0x15 }; //0x07类型是unsigned char
	//printf("%d", ba[0]);
	//printf(typeid(ba[0]).name());
	//Int2ByteArr(123456789, pBuf);
	//printf("bruce int2byte  ==>> pBuf[3]=%02x,pBuf[2]=%02x,pBuf[1]=%02x,pBuf[0]=%02x\n", pBuf[0], pBuf[1], pBuf[2], pBuf[3]);
	ByteArr2Int(ba,&i);
}

